package com.laozhao.server;
import javax.management.AttributeChangeNotification;
/**
* @author 作者  zhaoyu E-mail:774463266@qq.com
* @version 创建时间：2019年2月11日 下午2:03:59
* @description 
*/
import javax.management.Notification;   
import javax.management.NotificationListener;   
  
/**  
 * Server Configure Notification Listener  
 *   
 * @author haitao.tu  
 *   
 */  
public class ServerConfigureNotificationListener implements  
        NotificationListener {   
  
    @Override  
    public void handleNotification(Notification notification, Object handback) { 
    	AttributeChangeNotification n=(AttributeChangeNotification)notification;
        log("SequenceNumber:" + notification.getSequenceNumber());   
        log("Type:" + notification.getType());   
        log("Message:" + notification.getMessage());   
        log("Source:" + notification.getSource());   
        log("TimeStamp:" + notification.getTimeStamp());
        log("data:"+n.getOldValue()+"  change to :"+n.getNewValue());
        log("class:"+notification.getClass().getSimpleName());
    }   
  
    private void log(String message) {   
        System.out.println(message);   
    }   
  
}  